package code.google.jcontainer.test.countconsuming;

import code.google.jcontainer.AbstractContainer;
import code.google.jcontainer.ContainerFactory;
import org.junit.BeforeClass;
import org.junit.Test;

/**
 * @author <a href="mailto:jfox.young@gmail.com">Young Yang</a>
 * @create 2009-12-25 15:06:18
 */
public class CountConsumingTestCase {

    private static AbstractContainer simpleContainer;

    @BeforeClass
    public static void setup(){
        // get my simple container by name
        simpleContainer = ContainerFactory.scanPackages("code.google.jcontainer.test").getContainer("SimpleContainer");
    }

    @Test
    public void testSayHello() throws Exception {
        // get the simple component by name
        CountConsumingTestBean countConsumingTestBean = (CountConsumingTestBean)simpleContainer.getComponent("CountConsumingTestBean");
        // invoke sayHello
        countConsumingTestBean.countMe();
    }

}
